﻿{% extends "base.html" %}
{% block content %}
    <div id="main-container" class="container clearfix">
        <section class="post-left">
            <div class="row">
                <!-- /banner图 -->
                <div class="col-md-6">
                    <div id="featured" class="raxus-slider" data-autoplay="3000" data-keypress="false"
                         data-thumbnail="bottom">
                        <ul class="slider-relative" id="relative">
                            {% for banner in banners %}
                                <li class="slide fix-width">
                                    <a href="{{ banner.link_url }}"
                                       title="{{ banner.title }}">
                                        <img src="/media/{{ banner.img }}"
                                             srcset="/media/{{ banner.img }}"
                                             alt="{{ banner.text_info }}"
                                             class="wp-post-image" width="370" height="290"/></a>
                                    <span class="text ani-left"><strong>{{ banner.text_info }}</strong></span>
                                </li>
                            {% endfor %}
                        </ul>
                    </div>

                </div>
                <!-- /banner图 -->

                <!-- 首页推荐 -->
                <div class="col-md-6">
                    <div class="hotread ">
                        <div class="title">推荐阅读</div>
                        {% for tui in tuis %}
                            <div class="caption">
                                <h4><a href="{% url 'index' %}show-{{ tui.id }}"
                                       title="{{ tui.title }}"
                                       rel="bookmark">{{ tui.title }}</a></h4>
                                <p>{{ tui.excerpt|truncatechars:'80' }}</p>
                            </div>
                        {% endfor %}
                    </div>
                </div>
                <!-- /今日头条 -->
            </div>
            <!-- /文章列表 -->
            <div class="index-main clearfix">
                <div class="main-title">
                    <h4 class="post-left-title fl">最新文章</h4>
                    <div class="fr"></div>
                </div>
                <div class="row">
                    {% for article in latest_articles %}
                        <div class="article-box clearfix excerpt-1">
                            <div class="col-md-4">
                                <div class="thumbnail">
                                    <a href="{% url 'index' %}show-{{ article.id }}.html"
                                       title="{{ article.title }}">
                                        {% if  article.img %}
                                            <img src="/media/{{ article.img }}"
                                                 srcset="/media/{{ article.img }}"
                                                 alt="{{ article.title }}" class="wp-post-image" width="240"
                                                 height="160"/></a>

                                        {% else %}
                                            <img src="https://t1.hddhhn.com/uploads/tu/201903/17/1.jpg"
                                                 srcset="https://t1.hddhhn.com/uploads/tu/201903/17/1.jpg"
                                                 alt="{{ article.title }}" class="wp-post-image" width="240"
                                                 height="160"/></a>
                                        {% endif %}
                                </div>
                            </div>
                            <div class="col-md-8">
                                <h2><a href="{% url 'index' %}show-{{ article.id }}.html" target="_blank"
                                       title="{{ article.title }}">{{ article.title }}</a></h2>
                                <p class="txtcont hidden-xs"><a href="{% url 'index' %}show-{{ article.id }}.html"
                                                                target="_blank"
                                                                title="{{ article.title }}">{{ article.excerpt }}</a>
                                </p>
                                <div class="meta"><span class="label label-info"><a
                                        href="{% url 'index' %}list-{{ article.category.id }}.html">
                                    {{ article.category.name }}</a></span>
                                    <time class="item"><i class="fa fa-clock-o"></i>
                                        {{ article.created_time|date:"Y年m月d日" }}
                                    </time>
                                </div>
                            </div>
                        </div>
                    {% endfor %}
                </div>
            </div>
            <!-- /文章列表 -->
        </section>
        <!-- /post-left -->
        <!-- /post-right -->
        <aside class="post-right hidden-xs">
            </section>
            <section class="widget post-right-item">
                <h4 class="post-right-title">热门文章排行</h4>
                <ol class="hot-list">
                    {% for article in most_views_articles %}
                        <li><a href="{% url 'index' %}show-{{ article.id }}.html"
                               title="{{ article.title }}">
                            {{ article.title }}
                        </a>
                        </li>
                    {% empty %}
                        <li><a href="/show-3.html" title="微软发布IE10预览版 或增加IE5浏览模式 提供下载">微软发布IE10预览版 或增加IE5浏览模式 提供下载</a>
                        </li>
                    {% endfor %}

                </ol>
            </section>
            </section>
            </section>
            {% include 'right.html' %}

        </aside>
        <div class="FriendLink hidden-xs clearfix">
            <div class="title"><h3>友情链接：</h3></div>
            <ul class="clears">
                {% for link in links %}
                    <li><a href="{{ link.linkurl }}" target="_blank">{{ link.name }}</a></li>

                {% empty %}
                    <li><a href="https://lxgzhw520.com" target="_blank">快报名跟我学Python吧</a></li>

                {% endfor %}

            </ul>
        </div>
    </div>
{% endblock %}